package mx.messaging;

extern class Channel extends flash.events.EventDispatcher, implements mx.core.IMXMLObject {
	var authenticated(default,null) : Bool;
	var channelSets(default,null) : Array<Dynamic>;
	var connectTimeout : Int;
	var connected(default,null) : Bool;
	var enableSmallMessages : Bool;
	var endpoint(default,null) : String;
	var failoverURIs : Array<Dynamic>;
	var id : String;
	var mpiEnabled(default,null) : Bool;
	var protocol(default,null) : String;
	var reconnecting(default,null) : Bool;
	var recordMessageSizes(default,null) : Bool;
	var recordMessageTimes(default,null) : Bool;
	var requestTimeout : Int;
	var uri : String;
	var url : String;
	var useSmallMessages : Bool;
	function new(?id : String, ?uri : String) : Void;
	function applySettings(settings : XML) : Void;
	function connect(channelSet : ChannelSet) : Void;
	function disconnect(channelSet : ChannelSet) : Void;
	function initialized(document : Dynamic, id : String) : Void;
	function logout(agent : MessageAgent) : Void;
	function send(agent : MessageAgent, message : mx.messaging.messages.IMessage) : Void;
	function setCredentials(credentials : String, ?agent : MessageAgent, ?charset : String) : Void;
	private var _connecting : Bool;
	private var _log : mx.logging.ILogger;
	private var _loginAfterDisconnect : Bool;
	private var _recordMessageSizes : Bool;
	private var _recordMessageTimes : Bool;
	private var credentials : String;
	private var messagingVersion : Float;
	private function connectFailed(event : mx.messaging.events.ChannelFaultEvent) : Void;
	private function connectSuccess() : Void;
	private function connectTimeoutHandler(event : flash.events.TimerEvent) : Void;
	private function disconnectFailed(event : mx.messaging.events.ChannelFaultEvent) : Void;
	private function disconnectSuccess(?rejected : Bool) : Void;
	private function flexClientWaitHandler(event : mx.events.PropertyChangeEvent) : Void;
	private function getMessageResponder(agent : MessageAgent, message : mx.messaging.messages.IMessage) : MessageResponder;
	private function handleServerMessagingVersion(version : Float) : Void;
	private function internalConnect() : Void;
	private function internalDisconnect(?rejected : Bool) : Void;
	private function internalSend(messageResponder : MessageResponder) : Void;
	private function setConnected(value : Bool) : Void;
	private function setFlexClientIdOnMessage(message : mx.messaging.messages.IMessage) : Void;
	static var SMALL_MESSAGES_FEATURE : String;
}
